  <gd:isPermit roles="SYSTEM_ARTICLE" info="true">
<%@ page import="cn.gudian.cms.News.Article" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="article.list" default="Article List" /></title>
       <script language="javascript" src="/js/list-min.js"></script>
      <script>
        function selectArc(value){
          if(value!=""){
                 window.location.href="list?mode=${mode}&arcTypeID="+value;
             }else{
                 window.location.href="list?mode=${mode}";
             }
       }
      </script>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
            <span class="menuButton"><a href="/article/create?mode=${mode}"><g:message code="article.new" default="New Article" /></a></span>
        </div>
        <div class="body">
            <h1><g:message code="article.list" default="Article List" />
              <gd:arcTypeSelect nbsp="1" id="arcTypeID" mode="${mode}" nowID="${arcTypeID}" onChange="selectArc(this.options[this.options.selectedIndex].value)">
                <option>全部显示</option>
              </gd:arcTypeSelect></h1>
            <g:if test="${flash.message}">
            <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}" /></div>
            </g:if>
            <g:form  name="listForm" method="post">
            <input type="hidden" name="qstr" id="qstr">
            <input type="hidden" name="mode" id="mode" value="${mode}">
            <div class="list">
                <table>
                    <thead>
                        <tr>
                           <th width="30"><g:message code="chose" default="Chose" /></th>
                        
                   	    <g:sortableColumn property="id" title="Id" titleKey="article.id" />
                        
                   	    <th><g:message code="article.arcType" default="Arc Type" /></th>
                   	    
                   	    <g:sortableColumn property="title" title="Title" titleKey="article.title" />
                        
                   	    <g:sortableColumn property="shorttitle" title="Shorttitle" titleKey="article.shorttitle" />
                        
                   	    <g:sortableColumn property="writer" title="Writer" titleKey="article.writer" />
                        
                   	    <g:sortableColumn property="orderNum" title="Order Num" titleKey="article.orderNum" />
                        
                           <th width="30"><g:message code="edit" default="Edit" /></th>
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${articleInstanceList}" status="i" var="articleInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><input name="listId" type="checkbox" id="listId" value="${articleInstance.id}"/></td>
                            <td><g:link action="show" id="${articleInstance.id}">${fieldValue(bean: articleInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: articleInstance, field: "arcType")}</td>
                        
                            <td>${fieldValue(bean: articleInstance, field: "title")}${articleInstance.thumbnails?"<img src="+articleInstance.thumbnails+" width=80 height=60 />":""}<gd:formatBoolean boolean="${articleInstance.ismake}" true="&nbsp;" false="['未审核']" /></td>
                        
                            <td>${fieldValue(bean: articleInstance, field: "shorttitle")}</td>
                        
                            <td>${fieldValue(bean: articleInstance, field: "writer")}</td>
                        
                            <td>${fieldValue(bean: articleInstance, field: "orderNum")}</td>
                        
                           <td><a href="/article/edit?id=${articleInstance.id}&mode=${mode}"><img src="/images/skin/database_edit.png" /></a></td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
               </g:form>
            <div class="paginateButtons">
                 <a href="javascript:selAll()"><g:message code="allChose" default="allChose"/></a> <a href="javascript:noSelAll()"><g:message code="cancel" default="Cancel"/></a><a href="javascript:delArc(0)">&nbsp;<g:message code="delete" default="Delete"/>&nbsp;</a><a href="#" onClick="return audit(0)">&nbsp;审核&nbsp;</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<g:paginate total="${articleInstanceTotal}"  params="${params}"/>
            </div>
        </div>
    </body>
</html>
</gd:isPermit>